#!/bin/bash
# 编译项目
# mvn clean package -Dmaven.test.skip=true -U
# 构建镜像
docker rmi -f registry.cn-hangzhou.aliyuncs.com/web-cloud-project/mysql:5.7
docker build -t registry.cn-hangzhou.aliyuncs.com/web-cloud-project/mysql:5.7 .
docker login --username=1023106416@qq.com registry.cn-hangzhou.aliyuncs.com
# 为原始镜像改名和打标签(一般是版本号)
# docker tag 2b657ea52438 registry.cn-hangzhou.aliyuncs.com/web-cloud-project/mysql:5.7
# 推送镜像到镜像仓库
docker push registry.cn-hangzhou.aliyuncs.com/web-cloud-project/mysql:5.7
echo "Build completed. Press [Enter] to exit."
read -p ""